import request from '@/utils/request'
import qs from 'qs'


export function pageManager(current, limit, name) {
    return request({
        url: `/manager/pageManager/${current}/${limit}`,
        method: 'get',
        params: { name }
    })
}

export function getManagerById(id) {
    return request({
        url: `/manager/getManagerById/${id}`,
        method: 'get'
    })
}


export function register(params) {
    return request({
        url: `/manager/register`,
        method: 'post',
        data: qs.stringify(params)
    })
}
export function deleteManagersById(id) {
    return request({
        url: `/manager/deleteManagersById/${id}`,
        method: 'delete'
    })
}


export function updateManager(params) {
    return request({
        url: `/manager/updateManager`,
        method: 'post',
        data: qs.stringify(params)
    })
}

export function getTokenManager(token) {
    return request({
        url: `/manager/getMemberInfo`,
        method: 'get',
        headers: {
            token: token
        }
    })
}
export function updatePasswordById(id, pwd) {
    return request({
        url: `/manager/updatePasswordById/${id}`,
        method: 'post',
        data: qs.stringify(pwd)
    })
}